﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace ShareFolder
{
    public partial class Settings : PhoneApplicationPage
    {
        public Settings()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedFrom(NavigationEventArgs navigationEventArgs_0)
        {
            App.ViewModel.SaveSettings();
            base.OnNavigatedFrom(navigationEventArgs_0);
        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (App.ViewModel.AppSettings.EnableSkyDrive)
            {
                //this.tsSkyDrive.IsChecked = new bool?(true);
            }
        }

        private void tsSkyDrive_Checked(object sender, RoutedEventArgs e)
        {

            MessageBox.Show("Sorry, SkyDrive support is not available in trial mode.");
            App.ViewModel.AppSettings.EnableSkyDrive = false;
            //this.tsSkyDrive.IsChecked = new bool?(false);
        }

        private void tsSkyDrive_Unchecked(object sender, RoutedEventArgs e)
        {
            App.ViewModel.AppSettings.EnableSkyDrive = false;
        }
    }
}